<div class="hbox hbox-auto-xs hbox-auto-sm" ng-init="
    app.settings.asideFolded = false;
    app.settings.asideDock = false;
  ">
    <!-- main -->
    <div class="col">
        <!-- main header -->
        <div class="bg-light lter b-b wrapper-md">
            <div class="row">
                <div class="col-sm-6 col-xs-12">
                    <h1 class="m-n font-thin h3 text-black">DNSMASQ</h1>
                    <small class="text-muted">DNS配置管理</small>
                </div>
            </div>
        </div>
        <!-- / main header -->
        <div class="wrapper-md">
            <!-- toaster directive -->
            <toaster-container
                    toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
            <!-- / toaster directive -->

            <uib-tabset>
                <div class="panel panel-default" ng-controller="dnsmasqCtrl">
                    <div class="panel-body">
                        <form class="form-inline" role="form">
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-addon">配置项</span>
                                    <input type="text" class="form-control" ng-model="queryDnsItem" placeholder="配置项">
                                </div>
                            </div>
                            <div class="form-group">
                                <button type="button" class="btn btn-info" ng-click="doQuery()"><span
                                        class="glyphicon glyphicon-search"></span>搜索
                                </button>
                                <button type="button" class="btn btn-info" ng-click="reSet()"><span
                                        class="glyphicon glyphicon-repeat"></span>重置
                                </button>
                                <button type="button" class="btn btn-success" ng-click="addDnsmasq()"
                                        ng-if="contains(authPoint, '/dns/save')"><span
                                        class="glyphicon glyphicon-plus"></span>新增
                                </button>
                                <button type="button" class="btn btn-info" ng-click="viewDnsmasq()"><span
                                        class="glyphicon glyphicon-search"></span>查看配置
                                </button>
                                <button type="button" class="btn btn-info" ng-click="buildDnsmasq()"><span
                                        class="glyphicon glyphicon-ok"></span>保存配置
                                </button>
                            </div>
                        </form>

                        <div class="panel panel-default" style="margin-top: 5px;;">
                            <div class="panel-body">
                                <div>
                                    <table class="table table-hover table-bordered table-striped">
                                        <thead>
                                        <tr>
                                            <td>配置项</td>
                                            <td>说明</td>
                                            <td>创建时间</td>
                                            <td ng-if="contains(authPoint, '/dns/save')">操作</td>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="item in pageData">
                                            <td>
                                                <span class="label" style="background-color: #00a8f3; color: white;">{{item.dnsItem}}</span>
                                            </td>
                                            <td>{{item.content}}</td>
                                            <td>{{(item.gmtModify == null || item.gmtModify == '') ? item.gmtCreate
                                                : item.gmtModify}}
                                            </td>
                                            <td ng-if="contains(authPoint, '/dns/save')">
                                                <button ng-click="editDnsmasq(item)"
                                                        class="btn btn-xs"
                                                        style="margin-left: 5px; background-color: #2e6da4; color: white;">
                                                    <span class="glyphicon glyphicon-edit"></span>编辑
                                                </button>

                                                <button ng-click="delDnsmasq(item.id)"
                                                        class="btn btn-xs pull-right"
                                                        style="background-color: red; color: white;">
                                                    <span class="glyphicon glyphicon-remove"></span>删除
                                                </button>
                                            </td>
                                        </tr>
                                        </tbody>
                                        <tfoot>
                                        <tr>
                                            <td colspan="5">
                                                <ul style="margin: 0px; float: right;" uib-pagination
                                                    total-items="totalItems" ng-model="currentPage"
                                                    items-per-page="pageLength" max-size="10"
                                                    ng-change="pageChanged()" previous-text="&lsaquo;"
                                                    next-text="&rsaquo;"></ul>
                                            </td>
                                        </tr>
                                        </tfoot>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </uib-tabset>
        </div>
    </div>
    <!-- / main -->
</div>

<script type="text/ng-template" id="dnsmasqInfo">
    <div ng-include="'tpl/modal/dns/dnsmasq_info_modal.html'"></div>
</script>


<script type="text/ng-template" id="dnsmasqConfInfoModal">
    <div ng-include="'tpl/modal/dns/dnsmasq_conf_info_modal.html'"></div>
</script>
